package com.liqin.nothing.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author gonghl
 * @since 2024/5/29 下午 5:32
 */
@Getter
public enum PersonGenderEnum {

    MALE(1, "男"),
    FEMALE(2, "女");

    @EnumValue // 标明该字段存入数据库
    private final Integer code;

    @JsonValue // 标明在转JSON时使用该字段
    private final String desc;

    PersonGenderEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
